/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2024-03-11
 * Time: 10:26
 */
/*
public class Student {
    public String name;
    public String gender;
    public int age;

    Student(){
    }

    Student(String name, String gender, int age){
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public void getName(String name){
        this.name = name;

    }
    public String printName(){
        return name;
    }
    public static void main(String[] args) {
        Student student = new Student();
        student.getName("张三");
        System.out.println(student.printName());
    }
}*/






/*
public class Student {
    public String name;
    public String gender;
    public int age;
    public String classRoom;

    Student() {
    }
    Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    Student(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public void getName(String name) {
        this.name = name;
    }

    public String printName() {
        return name;
    }

    public static void main(String[] args) {
        Student student1 = new Student("张三", 27);
        student1.classRoom = "计算机科学与技术";
        Student student2 = new Student("李四", 18);
        student2.classRoom = "计算机科学与技术";
        Student student3 = new Student("王五", 20);
        student3.classRoom = "计算机科学与技术";
    }
}*/






public class Student {
    public String name;
    public String gender;
    public int age;
    public static String classRoom;

    public Student() {
    }

    public Student(String name, String gender) {
        this.name = name;
        this.gender = gender;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public Student(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public void getName(String name) {
        this.name = name;
    }

    public String printName() {
        return name;
    }

    public static void main(String[] args) {
        Student.classRoom = "计算机科学与技术";
        System.out.println(Student.classRoom);
    }

}



